package es.onlysolutions.gs.comm.entity;

import es.onlysolutions.arq.core.accesobd.IEntityId;

/**
 * Hibernate entity for the t_user_config table.
 */
public class UserConfig implements IEntityId
{

    public String getIdName()
    {
        return "id";
    }

    private Long id;
    private String property;
    private String value;
    private User user = new User();//To avoid null pointer in the automatic listing.

    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public String getProperty()
    {
        return property;
    }

    public void setProperty(String property)
    {
        this.property = property;
    }

    public String getValue()
    {
        return value;
    }

    public void setValue(String value)
    {
        this.value = value;
    }

    public User getUser()
    {
        return user;
    }

    public void setUser(User user)
    {
        this.user = user;
    }

    public boolean equals(Object o)
    {
        if (this == o)
        {
            return true;
        }
        if (o == null || getClass() != o.getClass())
        {
            return false;
        }

        UserConfig that = (UserConfig) o;

        if (id != null ? !id.equals(that.id) : that.id != null)
        {
            return false;
        }

        return true;
    }

    public int hashCode()
    {
        return (id != null ? id.hashCode() : 0);
    }


    public String toString()
    {
        return "UserConfig{" +
                "property='" + property + '\'' +
                ", value='" + value + '\'' +
                ", user=" + user +
                '}';
    }
}
